<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>（工资管理）岗位工资变更</title>
  <link rel="stylesheet" href="../../dist/css/layui.css">
  <script src="../../dist/jquery-1_8_3.js"></script>
  <script src="../../dist/layui.js"></script>
</head>
<body>

<table id="demo" lay-filter="test"></table>
<script>

  layui.use('table', function(){
    var table = layui.table;

    table.render({
      elem: '#demo'
      ,height: "full-20"
      ,url: '/admin/selectJobSalary' //数据接口
      ,page: {
        limit : 10,
        limits: [5, 10]
      } //开启分页
      ,id: 'tableSource'
      ,cols: [[ //表头
        {field: 'year', title: '学年',align: "center", width:'17%', sort: true}
        ,{field: 'term', title: '学期',align: "center", width:'17%'}
        ,{field: 'dept', title: '部门',align: "center", width:'17%', sort: true}
        ,{field: 'job', title: '岗位',align: "center", width:'17%'}
        ,{field: 'salary', title: '工资',align: "center", width:'17%', sort: true, style: 'color: dodgerblue'}
        ,{field: 'operation', title: '操作',  width:'13%', align:'center', toolbar: '#barDemo'}
      ]]
    });

    // 操作选项
    table.on('tool(test)', function (obj) {

      // 本行数据
      var data = obj.data;
      switch (obj.event) {
              //ajax
        case "update" :
          layer.open({
            type: 2,
            title:"岗位工资变更",
            area: ['400px', '300px'],
            offset: ['120px', '200px'],
            btn: '关闭',
            content: '/jsp/admin/update_job_salary.jsp?id='+ data.id + '&salary=' + data.salary,
            yes:function(index, layero){

              layer.close(index);
              return false;
            },
            //
            end : function () {
            }
          });
          break;
      }
    });
  });
</script>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-sm" lay-event="update">修改</a>
</script>
</body>
</html>